package co.yixiang.retail.biz.product.mapper;

import co.yixiang.common.mproot.common.mapper.CoreMapper;
import co.yixiang.retail.common.domain.YxUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface YxUserMapper extends CoreMapper<YxUser> {

    @Select("select yx_user.* from yx_system_store " +
            "LEFT JOIN yx_user ON yx_user.uid = yx_system_store.user_id " +
            "where yx_system_store.id = #{storeId}")
    YxUser queryByStoreId(@Param("storeId")Integer storeId);

    @Select("select yx_user.* from yx_user " +
            "where " +
            "yx_user.uid = #{uid}")
    YxUser queryByUid(@Param("uid")Integer uid);
}
